<template>
  <div class="contioner">
    <div class="search-form divClass" v-if="headerShow" style="margin-top: 15px">
      <a-form size="small" :model="query" layout="inline">
        <a-form-item label="厂区" prop="planOrderCode">
          <a-input
            allow-clear
            :style="{ width: '180px' }"
            class="bacClass"
            v-model="query.planOrderCode"
          />
        </a-form-item>
        <a-form-item label="楼层" prop="planOrderCode">
          <a-input
            allow-clear
            :style="{ width: '180px' }"
            class="bacClass"
            v-model="query.planOrderCode"
          />
        </a-form-item>
        <a-form-item label="机型" prop="planOrderCode">
          <a-input
            allow-clear
            :style="{ width: '180px' }"
            class="bacClass"
            v-model="query.planOrderCode"
          />
        </a-form-item>
        <a-form-item label="日期" prop="beginDate">
          <a-date-picker  popup-container="html" 
            v-model="query.beginDate"
            :style="{ width: '180px' }"
            placeholder="选择开始日期"
            class="bacClass"
          />
        </a-form-item>

        <a-form-item label="至" prop="endDate">
          <a-date-picker  popup-container="html" 
            v-model="query.endDate"
            :style="{ width: '180px' }"
            placeholder="选择开始日期"
            class="bacClass"
          />
        </a-form-item>
      </a-form>
      <div class="my-tool-bar" style="margin-bottom: 5px">
        <a-space>
          <el-button type="primary" :icon="Search" @click="getList">查询</el-button>
          <el-button pain @click="emit('takebiaoji', 0)" plain>返回主页</el-button>
        </a-space>
      </div>
    </div>
    <div class="my-divisders">
      <a-divider orientation="center">
        <icon-double-up v-if="headerShow" @click="headerShow = false" :strokeWidth="2" :size="18" />
        <icon-double-down v-else @click="headerShow = true" :strokeWidth="2" :size="18" />
      </a-divider>
    </div>
    <div style="background-color: #f0f2f5; height: 20px"></div>
    <div :style="{ height: '89%', padding: '10px' }">
      <div style="width: 100%; height: 100%">
        <encapsulation-agrid ref="refgridOption" :configaggrid="configaggrid"></encapsulation-agrid>
      </div>
    </div>
  </div>
</template>
  
  <script lang="ts" setup>
// 引入element提示
import { ElMessage, ElMessageBox } from 'element-plus'
//引入封装post
import { post } from '@/api/http'
import buttionRender from '@/components/aggridCellRenDerer/buttionRender.vue'
import { tableColumns } from './ClothWarehouseIntoStorage'
import CorporateSectorCascader from '@/components/corporateSectorCascader/inde.vue'
import { Search, EditPen } from '@element-plus/icons-vue'
import dayjs from 'dayjs'

const emit = defineEmits(['takebiaoji'])
const headerShow = ref<boolean>(true)

interface Pagein {
  dataList: any
  dialogFormVisible: boolean
  pageType: string
  showAdd: boolean
  loading: boolean
}

// 跟请求参数无关的放这里
let pageData = reactive<Pagein>({
  dataList: [],
  dialogFormVisible: false,
  pageType: '',
  showAdd: false,
  loading: false,
})

interface Querin {
  beginDate: any
  endDate: any
  planOrderCode: string
}
const form = ref<any>({})
//getlist初始化接口参数
let query = reactive<Querin>({
  beginDate: dayjs().subtract(7, 'day').format('YYYY-MM-DD'), //当天日期
  endDate: dayjs().format('YYYY-MM-DD'), //当天日期
  planOrderCode: '',
})
let refgridOption = ref<any>()
let configaggrid = ref({
  url: 'wms/GreyStockIn/getPage', //接口路径
  queryData: {
    //接口参数
  },
  paginationShow: true, //分页是否显示
  invokeiIterface: true, //是否调用接
  rowMultiSelectWithClick: true, //点击行是否多选
  column: tableColumns,
})
//获取数据
const getList = async () => {
  refgridOption.value.setQuery(query)
}

//初始化
onMounted(() => {
  // getList()
})
</script>
  <script lang="ts">
export default defineComponent({
  name: 'ClothWarehouseIntoStorage',
})
</script>
  <style scoped>
.contioner {
  height: 100%;
}

:deep(.ag-cell) {
  border-right: 1px solid #dde2eb;
}

:deep(.ag-header-cell) {
  border-right: 1px solid #dde2eb;
}

:deep(.ag-cell-value) {
  user-select: initial;
  -moz-user-select: text;
  -ms-user-select: text;
  -webkit-user-select: text;
}
</style>
  